﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Mpfr.Structs
{
  public unsafe class gmp_randstate_t : IDisposable
  {
    internal __gmp_randstate_struct* gmp_randstate_ptr;

    public gmp_randstate_t()
    {
      gmp_randstate_ptr = (__gmp_randstate_struct*)Marshal.AllocHGlobal(sizeof(__gmp_randstate_struct));
    }

    ~gmp_randstate_t()
    {
      Dispose();
    }

    public void Dispose()
    {
      if (gmp_randstate_ptr != null)
      {
        Marshal.FreeHGlobal((IntPtr)gmp_randstate_ptr);
        gmp_randstate_ptr = null;
      }
    }
  }
}
